<?php
	class the_gladius extends Gladius {
		function get_results($q) {
			$this->fetch_mode = GLADIUS_FETCH_DEFAULT;
			$data = $this->query($q);
			$head = $data->Fields();
			$data = $data->GetArray();
			return $data; 
		}
		function db_exists($name) {
			$data = $this->get_results("SHOW DATABASES");			
			foreach($data as $row) {
				if (strtolower($row["database"]) == strtolower($name)) return true;
			}
			return false;
		}
		function db_create($name) {
		    $name = strtolower($name);
			$this->query("CREATE DATABASE $name");
		}
		function db_use($name) {
		    $name = strtolower($name);
			$this->query("USE $name");
		}
	}
?>
